<?php

class calificacion extends object_standard {
//CONSTRAINT u_cal FOREIGN KEY (`usuariocalif`) REFERENCES usuario(`cedula`), 
// CONSTRAINT u_com FOREIGN KEY (`usuariocoment`) REFERENCES usuario(`cedula`) ,
 //CONSTRAINT u_res FOREIGN KEY (`respuesta`) REFERENCES respuesta(`id`)  
    protected $respuesta;
    protected $usuariocoment;
    protected $usuariocalif;
    var $components = array();
    var $auxiliars = array();

    public function attributes() {
        return array("usuariocoment" => array("foreign_name"=>"u_com", "foreign" => "usuario", "foreign_attribute" => "username"),"usuariocalif" => array("foreign_name"=>"u_cal", "foreign" => "usuario", "foreign_attribute" => "username"),"respuesta" => array("foreign_name"=>"u_res", "foreign" => "peticion", "foreign_attribute" => "id"));
    }

    public function primary_key() {
        return array("id");
    }

    public function relational_keys($class, $rel_name) {
		switch ($class) {
			case "usuario":
				switch ($rel_name) {
					case "u_com":
						return array("usuario");
						break;
                                        case "u_cal":
						return array("usuario");
						break;
				}
				break;
                        case "respuesta":
				switch ($rel_name) {
					case "u_res":
						return array("respuesta");
						break;
				}
				break;
			default:
				break;
		}
	}
}

?>